<me:UIAP04M x:Class="WPFExcelReport.TAPKOPF"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                     xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT"   
                     xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR"  
                    xmlns:APF="clr-namespace:WPFExcelReport;assembly=TAPFOLGE"     
                    xmlns:ATK="clr-namespace:WPFExcelReport;assembly=TAPARTK" 
                    xmlns:ATE="clr-namespace:WPFExcelReport;assembly=TAPARTE"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIAP04M.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="nbv"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIAP04M.Resources>
    <TabControl>
        <TabItem Header="{Binding Source={Localization:Translate Word=流程清单}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="1.5*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="1"  >
                    <WrapPanel>
                        <WrapPanel>
                            <Button Click="ResetSeq" Content="{Binding Source={Localization:Translate Word=重置序列号}}"
                    Visibility="{Binding IsITX,Converter={StaticResource bv}}"/>
                        </WrapPanel>
                        <WrapPanel>
                            <Button  Click="EditCommand" Width="24" Height="20" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                                </Button.Background>
                            </Button>
                            <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24"  Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                                </Button.Background>
                            </Button>
                            <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24"  Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                                </Button.Background>
                            </Button>

                            <WrapPanel >
                                <TextBlock Text="{Binding Source={Localization:Translate Word=类型}}"/>
                                <SD:K8882 Grid.Column="1" 
                                   KEY="{Binding Path=ARTST,ElementName=TV}" 
                                  IsEdit="True"  Width="Auto" />
                                <TextBlock FontSize="16"  Text="{Binding Source={Localization:Translate Word=流程}}"/>
                                <ex:TXT72 Grid.Column="1"  MaxLength="2"   IsAutoClear="True" 
                              CharacterCasing="Upper" Text="{Binding KRS,ElementName=TV}" Width="30" />
                                <ex:TXT72 Grid.Column="2"   Margin="5,0,0,0" MaxLength="6"  IsAutoClear="True" 
                              Text="{Binding LFD,ElementName=TV}" KeyUp="Query_KeyUp" Width="60" />

                            </WrapPanel>
                            <Button Grid.Column="0"  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                                </Button.Background>
                            </Button>
                        </WrapPanel>
                        <WrapPanel>
                            <WrapPanel>
                                <Button Grid.Column="0"  Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24"
                            IsEnabled="{Binding IsCanNew,ElementName=TV}"
                            >
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                                    </Button.Background>
                                </Button>
                                <WrapPanel Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}">
                                    <TextBlock  Text="{Binding Source={Localization:Translate Word=物料类型:}}"/>
                                    <SD:K8882 Grid.Column="1" MinWidth="100" 
                         KEY="{Binding Path=ARTST,ElementName=TV}" 
                        IsEdit="True"
                       Width="100" />
                                    <TextBlock  Text="{Binding Source={Localization:Translate Word=流程}}"/>
                                    <ex:TXT72  MaxLength="2"  PRE="  "
                              CharacterCasing="Upper" Text="{Binding KRS,ElementName=TV}" Width="30" />
                                    <ex:TXT72  Margin="5,0,0,0" MaxLength="6"   
                               PRE="000000"
                              Text="{Binding LFD,ElementName=TV}"   Width="90" />

                                    <Button Grid.Column="0"  Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                        </Button.Background>
                                    </Button>
                                </WrapPanel>
                            </WrapPanel>
                            <WrapPanel>
                                <Button Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24"  IsEnabled="{Binding IsCanDelete,ElementName=TV}">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Copy.png" />
                                    </Button.Background>
                                </Button>
                                <WrapPanel Visibility="{Binding IsCopy,ElementName=TV,Converter={StaticResource bv}}">
                                    <TextBlock  Text="{Binding Source={Localization:Translate Word=流程}}"/>
                                    <ex:TXT72  MaxLength="2"  PRE="  "
                              CharacterCasing="Upper" Text="{Binding KRS,ElementName=TV}" Width="30" />
                                    <ex:TXT72  Margin="5,0,0,0" MaxLength="6"   
                               PRE="000000"
                              Text="{Binding LFD,ElementName=TV}"   Width="90" />

                                    <Button Grid.Column="0"  Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                        <Button.Background>
                                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                        </Button.Background>
                                    </Button>
                                </WrapPanel>
                            </WrapPanel>
                            <WrapPanel >
                                <ex:TXT72
                    IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                    Text="{Binding APKSPEZIF,Converter={StaticResource gb2312}}" Width="200" />
                            </WrapPanel>
                        </WrapPanel>
                    </WrapPanel>
                    <WrapPanel  Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=输入:}}"/>
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKZUSATZKZ1,ElementName=TV}" 
                          ORDERNUM="{Binding APKZUSATZKZ1,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKZUSATZKZ2,ElementName=TV}" 
                          ORDERNUM="{Binding APKZUSATZKZ2,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKZUSATZKZ3,ElementName=TV}" 
                          ORDERNUM="{Binding APKZUSATZKZ3,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKZUSATZKZ4,ElementName=TV}" 
                          ORDERNUM="{Binding APKZUSATZKZ4,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                        </WrapPanel>
                        <WrapPanel >
                            <TextBlock Text="{Binding Source={Localization:Translate Word=输出:}}"/>
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKGZUSKZ1,ElementName=TV}" 
                          ORDERNUM="{Binding APKGZUSKZ1,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKGZUSKZ2,ElementName=TV}" 
                          ORDERNUM="{Binding APKGZUSKZ2,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKGZUSKZ3,ElementName=TV}" 
                          ORDERNUM="{Binding APKGZUSKZ3,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                            <SD:K9321 Margin="10,0,0,0"
                    KEY="{Binding APKGZUSKZ4,ElementName=TV}" 
                          ORDERNUM="{Binding APKGZUSKZ4,ElementName=TV}"
                          IsEdit="{Binding IsEdit,ElementName=TV}"
                          />
                        </WrapPanel>

                    </WrapPanel>
                    <WrapPanel Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}">
                        <WrapPanel >
                            <TextBlock Text="{Binding Source={Localization:Translate Word=输入:}}"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKZUSATZKZ1}" Width="40"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKZUSATZKZ2}" Width="40"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKZUSATZKZ3}" Width="40"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKZUSATZKZ4}" Width="40"/>
                        </WrapPanel>
                        <WrapPanel >
                            <TextBlock Text="{Binding Source={Localization:Translate Word=输出:}}"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKGZUSKZ1}" Width="40"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKGZUSKZ2}" Width="40"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKGZUSKZ3}" Width="40"/>
                            <TextBlock  Margin="10,0,0,0" Text="{Binding APKGZUSKZ4}" Width="40"/>
                        </WrapPanel>
                    </WrapPanel>
                </StackPanel>

                <DataGrid  Grid.Row="1"  Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn  Binding="{Binding APKSTUFE}"  Header="{Binding Source={Localization:Translate Word=物料类型}}"/>
                        <DataGridTextColumn Binding="{Binding Path=APKSPSTA}" Header="{Binding Source={Localization:Translate Word=状态}}" Width="Auto"  />
                        <DataGridTextColumn Binding="{Binding APKANRKRS}" Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding APKALFDNR}" Header="{Binding Source={Localization:Translate Word=流程}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKSPEZIF,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKZUSATZKZ1}" Header="{Binding Source={Localization:Translate Word=进入1}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKZUSATZKZ2}" Header="{Binding Source={Localization:Translate Word=进入2}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKZUSATZKZ3}" Header="{Binding Source={Localization:Translate Word=进入3}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKZUSATZKZ4}" Header="{Binding Source={Localization:Translate Word=进入4}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKGZUSKZ1}" Header="{Binding Source={Localization:Translate Word=产出1}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKGZUSKZ2}" Header="{Binding Source={Localization:Translate Word=产出2}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKGZUSKZ3}" Header="{Binding Source={Localization:Translate Word=产出3}}" Width="Auto"/>
                        <DataGridTextColumn  Binding="{Binding APKGZUSKZ4}" Header="{Binding Source={Localization:Translate Word=产出4}}" Width="Auto"/>

                    </DataGrid.Columns>
                </DataGrid  >
                <APF:TSWAP02 Grid.Row="2"
                             IsAutoAPK="False" 
                             IsAuto="False"
                        ARTST="{Binding ARTST,ElementName=TV}"
                          DES="{Binding DES,ElementName=TV}"
                          EXAUF="{Binding KEY,ElementName=TV}"
                          QTY="{Binding QTY,ElementName=TV}"
                    />
            </Grid>
        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=流程管理}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <Grid Grid.Row="0" Grid.Column="0">
                    <StackPanel Grid.Row="0">
                        <WF:TSWF ART="{Binding ART,ElementName=TV}" 
                         VAR="{Binding VAR,ElementName=TV}" 
                         FARBE="{Binding FARBE,ElementName=TV}" 
                         FINISH="{Binding FINISH,ElementName=TV}" 
                         DESS="{Binding DESS,ElementName=TV}" 
                         COLORIT="{Binding COLORIT,ElementName=TV}" 
                         IsEdit="{Binding IsExpanded,ElementName=cZoneART}"/>
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=品种：}}"/>
                            <ex:TXT72 Text="{Binding ART,ElementName=TV}" Width="160" MaxLength="20" />
                            <ex:TXT72 Text="{Binding VAR,ElementName=TV}"  Width="20" MaxLength="2" />
                            <TextBlock Text="{Binding Source={Localization:Translate Word=色号：}}"/>
                            <ex:TXT72 Text="{Binding FARBE,ElementName=TV}"  Width="80" MaxLength="10" />
                            <TextBlock Text="{Binding Source={Localization:Translate Word=后整理：}}"/>
                            <ex:TXT72 Text="{Binding FINISH,ElementName=TV}"  Width="80" MaxLength="10" />
                            <Button Grid.Column="0"  Click="ARTCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                                </Button.Background>
                            </Button>
                            <Button Grid.Column="0"  Click="AP04TestCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                                </Button.Background>
                            </Button>
                            <Button Grid.Column="0"  Click="NextTestCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-right.png" />
                                </Button.Background>
                            </Button>
                            <Button Grid.Column="0"  Click="AP04ReTestCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/arrow-rego.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Text="{Binding INFO,ElementName=TV}" Foreground="Red" Width="100"/>
                        </WrapPanel>
                        <WrapPanel>
                            <WS:TWS15  EXAUF="{Binding DES,ElementName=TV}" Name="cWS15"/>
                        </WrapPanel>
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=色号属性:}}"/>
                            <WF:TWS07 EXAUF="{Binding DES,ElementName=TV}" ZUART="C" Name="cC" />
                            <TextBlock Text="{Binding Source={Localization:Translate Word=染色属性:}}"/>
                            <WF:TWS07 EXAUF="{Binding DES,ElementName=TV}" ZUART="F" Name="cCF" />
                            <TextBlock Text="{Binding Source={Localization:Translate Word=整理属性:}}"/>
                            <WF:TWS07 EXAUF="{Binding DES,ElementName=TV}" ZUART="B" Name="cF" />
                            <TextBlock Text="{Binding Source={Localization:Translate Word=印花属性:}}"/>
                            <WF:TWS07 EXAUF="{Binding DES,ElementName=TV}" ZUART="D" Name="cD" />
                        </WrapPanel>
                    </StackPanel>
                </Grid>
                <APF:TAPFOLGE Grid.Row="1" Grid.Column="0"  
                          Name="cAP04" 
                          IsAutoAPK="True" 
                           ARTST="{Binding ARTST,ElementName=TV}"
                          DES="{Binding DES,ElementName=TV}"
                          EXAUF="{Binding KEY,ElementName=TV}"
                          QTY="{Binding QTY,ElementName=TV}"
                          IsAuto="True"   />
            </Grid>
        </TabItem>
    </TabControl>

</me:UIAP04M>
